﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="JobManage.aspx.vb" Inherits="Map.JobManage" %>
<%@ Register TagPrefix="mwc" Namespace="MySoft.WebControls" Assembly="MySoft.WebControls" %>
<%@ Register TagPrefix="cnt" Namespace="Mysoft.Map.Application.Controls" Assembly="Mysoft.Map.Application.Components" %>
<%@ Register TagPrefix="mnu" Namespace="Mysoft.Map.Application.Menus" Assembly="Mysoft.Map.Application.Components" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<head runat="server">
    <title>作业管理</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<link rel="stylesheet" type="text/css" href="/_grid/map_grid.css">
		<link rel="stylesheet" type="text/css" href="/_nav/menu.css">
		<script language="javascript" src="/_common/scripts/global.js"></script>
		<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">
		<link rel="stylesheet" type="text/css" href="/_controls/find/find.css">
		<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
		<script language="javascript" src="/_controls/settings.aspx"></script>
		<script language="javascript" src="/_controls/util/util.js"></script>
		<script language="javascript" src="/_controls/datetime/date.js"></script>
		<script language="javascript" src="/_controls/number/number.js"></script>
		<script language="javascript" src="/_controls/find/find.js"></script>
		<script type ="text/javascript">
		    //在线帮助文件
		    var _MyHelpfile = "/help/yxsz.htm";
		    // 清空 AppFind 的查询条件

		    function window.onload()
		    {
		        appQuery.clickQuery();
		        var sFile = "/DBJob/DBJob_Pub_XMLHTTP.aspx";
		        var strReturn = __openXMLHTTP(sFile, "TestJob");
		        if (strReturn != "OK")
		        {
		            alert(strReturn);
		        }		        
		    }

		    function ClearAppFind()
		    {
		        appFind.clearQuery();
		    }	
		   	
		    //启用或禁用选中的作业
		    function doEnabled(status)
		    {
		        var selected = document.getElementById("appIframe").contentWindow.appGrid.frameElement.getSelected();
		        if (selected.length == 0) return;
		        var selectIDs = "";
		        for (var i = 0; i < selected.length; i++)
		        {
		            if (i == 0)
		            {
		                selectIDs += selected[i].oid;
		            }
		            else
		            {
		                selectIDs += ";" + selected[i].oid;
		            }
		        }

		        if (status == 1) var rtn = window.confirm("您确定要启用选中的作业吗?");
		        else var rtn = window.confirm("您确定要禁用选中的作业吗?");
		        if (!rtn) return;
		        var sFile = "/DBJob/DBJob_Pub_XMLHTTP.aspx?status=" + status;
		        var strReturn = __openXMLHTTP(sFile, "SetJobStatus", selectIDs);
		        if (strReturn == "OK")
		        {
		            document.getElementById("appIframe").contentWindow.appGrid.frameElement.Refresh();
		        }
		        else if (strReturn == "NO")
		        {
		            alert("运行时异常，请与系统管理员联系！");
		        }
		        else
		        {
		            alert("操作失败，详细错误信息如下:\r\n" + strReturn);
		        }
		    }

            //安装作业
		    function doInstall(isCheck)
		    {
		        var sFile = "/DBJob/DBJob_Pub_XMLHTTP.aspx?check=" + isCheck;
		        var strReturn = __openXMLHTTP(sFile, "InstallJob");
		        if (strReturn == "OK")
		        {
		            alert("安装成功！");
		            document.getElementById("appIframe").contentWindow.appGrid.frameElement.Refresh();
		        }
		        else if (strReturn == "Abort")
		        {
		            var sRtn = openMyDlg("作业安装", "/DBJob/Job_InstallDiag.htm", "", '', 400, 130);
		            if (sRtn == "yes") doInstall(0);
		            else return;
		        }
		        else
		        {
		            alert("安装失败，详细信息如下:\r\n" + strReturn);
		        }
		    }
		    
		    //测试作业
		    function doCheck()
		    {
		        var sFile = "/DBJob/DBJob_Pub_XMLHTTP.aspx";
		        var strReturn = __openXMLHTTP(sFile, "TestJob");
		        if (strReturn == "OK")
		        {
		            alert("作业运行环境正常！");
		        }
		        else
		        {
		            alert("作业运行环境异常，详细信息如下:\r\n" + strReturn);
		        }  
		    }
		</script>
</head>
	<body MS_POSITIONING="GridLayout" class="tab" style="PADDING-RIGHT:15px; PADDING-LEFT:15px; PADDING-BOTTOM:15px; PADDING-TOP:15px">
		<table id="appQuery" class="appQuery" onquery="_DoQuery()" style="FONT-SIZE: 9pt" height="100%"
			border="0" cellSpacing="0" cellPadding="0" width="100%">
			<tr height="30">
				<td>
					<table style="TABLE-LAYOUT: fixed; VERTICAL-ALIGN: text-bottom; WIDTH: 100%; HEIGHT: 30px"
						cellSpacing="0" cellPadding="0" border="0">
						<COLGROUP>
							<col width="60">
							<col>
							<col width="20">
							<col>
							<col width="15">
						</COLGROUP>
						<tr>
							<td></td>
							<td>
							</td>
							<td align="center"><!--中间分割条--></td>
							<td>
								<cnt:AppViewList id="appViewList" runat="server" />
							</td>
							<td><!--占位格--></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr height="1">
				<td>
					<cnt:AppFind id="appFind" runat="server" />
				</td>
			</tr>
			<tr height="10">
				<td></td>
			</tr>
			<tr height="1">
				<td><mnu:AppGridMenu id="appGridMenu" runat="server" /></td>
			</tr>			
			<tr>
				<td>
					<iframe id="appIframe" url="JobManage_Grid.aspx" width="100%" height="100%" frameborder="0" scrolling="no">
					</iframe>
				</td>
			</tr>
		</table>
	</body>
</html>
